package com.lcifn.spring.ioc.scan;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.lcifn.spring.ioc.bean.SampleBean;

@Service
public class ScanSampleBean{
    
    @Autowired
    private ScanAutowiredBean scanAutowiredBean;
    
    private SampleBean sampleBean;
    
    @Value("#{prop['sample.prop']}")
    private String sampleProp;
    
    //@Autowired
    //private SampleBean sampleBean;
    
    public void print(){
        System.out.println("I'm a scan sample.");
        System.out.println("scanAutowiredBean:" + scanAutowiredBean);
        System.out.println("sampleBean:" + sampleBean);
        System.out.println("prop:" + sampleProp);
    }
    
    @Autowired
    @Required
    public void setSampleBean(SampleBean sampleBean){
        this.sampleBean = sampleBean;
    }
}
